﻿<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true"
    CodeFile="UserAccounts.aspx.cs" Inherits="admin_UserAccounts" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_setup.css" />
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_text.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <h1 class="block">
        Quản lý tài khoản người dùng:
    </h1>
    <hr class="clear-contentunit" />
    <telerik:RadGrid AutoGenerateColumns="False" ID="grvAccounts" AllowFilteringByColumn="True"
        AllowPaging="True" AllowSorting="True" runat="server" Width="990px"
        OnDeleteCommand="grvAccounts_OnDeleteCommand">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView TableLayout="Fixed" runat="server" AllowPaging="true" PageSize="10" DataKeyNames="UserName">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="20px" />
                <telerik:GridImageColumn DataImageUrlFields="avatar" ImageWidth="70px" ImageHeight="70px"
                    HeaderText="Ảnh đại diện" UniqueName="avatar" SortExpression="avatar" AutoPostBackOnFilter="true"
                    CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                <telerik:GridBoundColumn HeaderText="Tên Tài Khoản" DataField="UserName" UniqueName="UserName"
                    SortExpression="UserName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false" />
                <telerik:GridBoundColumn HeaderText=" Họ & Tên" DataField="fullName" UniqueName="fullName"
                    SortExpression="fullName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false" />
                <telerik:GridDateTimeColumn HeaderText="Ngày Sinh" DataField="birthday" UniqueName="birthday"
                    SortExpression="birthday" AutoPostBackOnFilter="true" CurrentFilterFunction="Custom"
                    ShowFilterIcon="false" DataType="System.DateTime" EmptyDataText="- không có -"
                    DefaultInsertValue="04/08/1985" PickerType="DatePicker" />
                <telerik:GridBoundColumn HeaderText="Địa Chỉ" DataField="address" UniqueName="address"
                    SortExpression="address" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false" />
                <telerik:GridBoundColumn HeaderText="Điện Thoại" DataField="phone" UniqueName="phone"
                    SortExpression="phone" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false" />
                <telerik:GridBoundColumn HeaderText="Email" DataField="email" UniqueName="email"
                    SortExpression="email" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false" />
                <telerik:GridCheckBoxColumn DataField="isActived" UniqueName="isActived" HeaderText="Kích hoạt" />
                <telerik:GridButtonColumn ConfirmText="Xoa nguoi dung nay?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" 
                CommandName="Delete" ButtonType="ImageButton" HeaderStyle-Width="20px" />
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <table cellspacing="2" cellpadding="1" width="100%" border="0">
                        <tr>
                            <td colspan="2">
                                <b>Mã:
                                    <%# Eval("userName")%>
                                </b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tình trạng:<asp:CheckBox ID="chkIsActived" runat="server" Checked='<%# Bind("isActived")%>'>
                                </asp:CheckBox>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnChange" runat="server" Text='Change' CommandName='Update'></asp:Button>
                                <asp:Button ID="Button2" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel">
                                </asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
    <hr class="clear-contentunit" />
    <!--
   ---------------------------------------------------- sử dụng ajax-----------------------------------------------------------------------
    -->
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanelAccount" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grvAccounts">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grvAccounts" LoadingPanelID="RadAjaxLoadingPanelAccount" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <!----------------------------------------hết đoạn sử dụng ajax-------------------------------------->
</asp:Content>
